var sql = require('../api/connect');
var list=function(req,res){
	var sqlrevise='';
	var projectId=req.body.projectId;
	if(req.body.pass!=''){
		sqlrevise+='pass="' + req.body.pass + '"'
	}
	var sqltext='UPDATE project set ' + sqlrevise + ' where project_id="'+projectId+'"';
	console.log(sqltext);
	sql.getConnection(function(err, connection) {
        if(err) throw err;
        connection.query(sqltext,function (err, results) {
            connection.release();
            if (err){
                res.end(JSON.stringify({msg:err,status:'400'}))
            }else{
                res.end(JSON.stringify({msg:'操作成功',status:'200'}));
           }
        })
    })
}
module.exports=list;
